package com.ytjj.qmyx.mall.mapper;

import com.ytjj.qmyx.mall.model.AliPayComplaintsListRequest;
import com.ytjj.qmyx.mall.model.AliPayComplaintsListResponse;
import com.ytjj.qmyx.mall.model.AlipayComplaintsRecords;
import com.ytjj.qmyx.mall.model.AlipayComplaintsRecordsExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface AlipayComplaintsRecordsMapper {
    long countByExample(AlipayComplaintsRecordsExample example);

    int deleteByExample(AlipayComplaintsRecordsExample example);

    int deleteByPrimaryKey(Integer id);

    /**
     * 根据投诉单号删除
     */
    int deleteByComplainEventId(String complainEventId);

    int insert(AlipayComplaintsRecords record);

    int insertSelective(AlipayComplaintsRecords record);

    List<AlipayComplaintsRecords> selectByExample(AlipayComplaintsRecordsExample example);

    AlipayComplaintsRecords selectByPrimaryKey(Integer id);

    List<AlipayComplaintsRecords> selectByComplainEventId(String complainEventId);

    int updateByExampleSelective(@Param("record") AlipayComplaintsRecords record, @Param("example") AlipayComplaintsRecordsExample example);

    int updateByExample(@Param("record") AlipayComplaintsRecords record, @Param("example") AlipayComplaintsRecordsExample example);

    int updateByPrimaryKeySelective(AlipayComplaintsRecords record);

    /**
     * 更新对象
     */
    int updateByParams(AlipayComplaintsRecords record);

    int updateByPrimaryKey(AlipayComplaintsRecords record);

    String queryChildId(@Param("complainEventId")String complainEventId);

    AlipayComplaintsRecords queryByComplainEventId(@Param("complainEventId")String complainEventId);

    /**
     * 获得支付宝小程序投诉
     */
    List<AliPayComplaintsListResponse> aliPayComplaintsList(AliPayComplaintsListRequest request);

    /**
     * 获得支付宝交易订单投诉
     */
    List<AliPayComplaintsListResponse> aliPayTradeComplaintsList(AliPayComplaintsListRequest request);

    List<AliPayComplaintsListResponse> aliPayTradeComplaintsListV2(AliPayComplaintsListRequest request);

    /**
     * 查询支付宝投诉信息
     * @param complainEventId
     * @return
     */
    AliPayComplaintsListResponse queryAliPayComplaints(@Param("complainEventId")String complainEventId);

    /**
     * 根据交易单号查询已有的投诉单
     * @param complainEventIds
     * @return
     */
    List<String> queryRecords(@Param("complainEventIds") List<String> complainEventIds);

    /**
     * 批量插入
     */
    int insertBatch(@Param("list") List<AlipayComplaintsRecords> list);

    /**
     * 根据支付单号更新投诉信息
     */
    int updateComplainByTradeNo(AlipayComplaintsRecords records);

    String findResOrderNo(String merchantNo);
}